<#assign ctx=springMacroRequestContext.contextPath />
<#import "/macro/Accordion.ftl" as Accordion>

<nav class="col-md-2 d-none d-md-block bg-light sidebar">
    <div class="sidebar-sticky">
        <@Accordion.Accordion id="navAccordion">
            <#assign expantSystem=active?? && (active=="authority" || active=="role" || active=="user")/>
            <@Accordion.Item id="systemManger" title="权限管理" parentId="navAccordion" expanted="${expantSystem}">
                <ul class="nav flex-column">
                    <@shiro.hasPermission name="authority:list" >
                        <li class="nav-item">
                            <a href="${ctx}/authority/list" class="nav-link  <#if active?? && active=="authority">active</#if>">
                                <i class="fa fa-address-card" aria-hidden="true" style="margin-right: 5px"></i>权限管理<span class="sr-only"></span>
                            </a>
                        </li>
                    </@shiro.hasPermission>
                    <@shiro.hasPermission name="role:list">
                        <li class="nav-item">
                            <a href="${ctx}/role/list" class="nav-link  <#if active?? && active=="role">active</#if>">
                                <i class="fa fa-address-card" aria-hidden="true" style="margin-right: 5px"></i>角色管理<span class="sr-only"></span>
                            </a>
                        </li>
                    </@shiro.hasPermission>
                    <@shiro.hasPermission name="user:list">
                        <li class="nav-item">
                            <a href="${ctx}/user/list" class="nav-link  <#if active?? && active=="user">active</#if>">
                                <i class="fa fa-address-book" aria-hidden="true" style="margin-right: 5px"></i>登录用户表管理<span class="sr-only"></span>
                            </a>
                        </li>
                    </@shiro.hasPermission>
                </ul>
            </@Accordion.Item>

            <#assign expantIm=active?? && (active=="imDepartment" || active=="imGroup" || active=="imUser" || active=="imTenant")/>
            <@Accordion.Item id="imManger" title="Im管理" parentId="navAccordion" expanted="${expantIm}">
                <ul class="nav flex-column">
                    <@shiro.hasPermission name="imDepartment:list">
                        <li class="nav-item">
                            <a href="${ctx}/imDepartment/list" class="nav-link  <#if active?? && active=="imDepartment">active</#if>">
                                <i class="fa fa-tree" aria-hidden="true" style="margin-right: 5px"></i>部门管理<span class="sr-only"></span>
                            </a>
                        </li>
                    </@shiro.hasPermission>
                    <@shiro.hasPermission name="imGroup:list">
                        <li class="nav-item">
                            <a href="${ctx}/imGroup/list" class="nav-link  <#if active?? && active=="imGroup">active</#if>">
                                <i class="fa fa-layer-group" aria-hidden="true" style="margin-right: 5px"></i>群组管理<span class="sr-only"></span>
                            </a>
                        </li>
                    </@shiro.hasPermission>
                    <@shiro.hasPermission name="imUser:list">
                        <li class="nav-item">
                            <a href="${ctx}/imUser/list" class="nav-link  <#if active?? && active=="imUser">active</#if>">
                                <i class="fa fa-user" aria-hidden="true" style="margin-right: 5px"></i>用户管理<span class="sr-only"></span>
                            </a>
                        </li>
                    </@shiro.hasPermission>

                    <@shiro.hasPermission name="imTenant:list">
                        <li class="nav-item">
                            <a href="${ctx}/imTenant/list" class="nav-link  <#if active?? && active=="imTenant">active</#if>">
                                <i class="fa fa-address-card" aria-hidden="true" style="margin-right: 5px"></i>租户管理<span class="sr-only"></span>
                            </a>
                        </li>
                    </@shiro.hasPermission>

                    <@shiro.hasPermission name="imSession:list">
                        <li class="nav-item">
                            <a href="${ctx}/imSession/list" class="nav-link  <#if active?? && active=="imSession">active</#if>">
                                <i class="fa fa-address-card" aria-hidden="true" style="margin-right: 5px"></i>会话管理<span class="sr-only"></span>
                            </a>
                        </li>
                    </@shiro.hasPermission>
                </ul>
            </@Accordion.Item>

            <#assign expantCms=active?? && (active=="cmsArticle" || active=="cmsCategory" || active=="cmsLabel")/>
            <@Accordion.Item id="cmsManger" title="CMS管理" parentId="navAccordion" expanted="${expantCms}">
                <ul class="nav flex-column">
                    <@shiro.hasPermission name="cmsarticle:list">
                        <li class="nav-item">
                            <a href="${ctx}/cmsArticle/list" class="nav-link  <#if active?? && active=="cmsArticle">active</#if>">
                                <i class="fa fa-book" aria-hidden="true" style="margin-right: 5px"></i>内容文章管理<span class="sr-only"></span>
                            </a>
                        </li>
                    </@shiro.hasPermission>
                    <@shiro.hasPermission name="cmscategory:list">
                        <li class="nav-item">
                            <a href="${ctx}/cmsCategory/list2" class="nav-link  <#if active?? && active=="cmsCategory">active</#if>">
                                <i class="fa fa-list" aria-hidden="true" style="margin-right: 5px"></i>内容类目管理<span class="sr-only"></span>
                            </a>
                        </li>
                    </@shiro.hasPermission>
                    <@shiro.hasPermission name="cmslabel:list">
                        <li class="nav-item">
                            <a href="${ctx}/cmsLabel/list" class="nav-link  <#if active?? && active=="cmsLabel">active</#if>">
                                <i class="fa fa-hashtag" aria-hidden="true" style="margin-right: 5px"></i>内容标签管理<span class="sr-only"></span>
                            </a>
                        </li>
                    </@shiro.hasPermission>
                </ul>
            </@Accordion.Item>

            <#assign expantLog=active?? && (active=="log")/>
            <@Accordion.Item id="logManger" title="日志管理" parentId="navAccordion" expanted="${expantLog}">
                <ul class="nav flex-column">
                    <@shiro.hasPermission name="log:list">
                        <li class="nav-item">
                            <a href="${ctx}/log/list" class="nav-link  <#if active?? && active=="log">active</#if>">
                                <i class="fa fa-hat-cowboy" aria-hidden="true" style="margin-right: 5px"></i>日志管理<span class="sr-only"></span>
                            </a>
                        </li>
                    </@shiro.hasPermission>
                </ul>
            </@Accordion.Item>
        </@Accordion.Accordion>

    </div>
</nav>